<?php

namespace App\Services;

use App\Models\GameLoginConfig;

class GameLoginService extends ServiceBase
{
    public function get($game_id)
    {
        $config = GameLoginConfig::where('game_id', $game_id)->first()->toArray();
        if ($config['need_idcard'] == 1) {
            $hour = date('H', time());
            if ($hour < $config['idcard_start_hour'] || $hour > $config['idcard_end_hour']) {
                $config['need_idcard'] = 0;
            }
        }

        return $config;
    }
}
